
public class Airline {
	
	private long airlineID;
	private String code;
	private String name;
	
	private boolean idSet = false;
	
	public Airline(String code) {
		this.code = code;
	}
	public Airline(String code, String name) {
		this(code);
		this.name = name;
	}
	
	public void setAirlineID(long airlineID) {
		this.airlineID = airlineID;
		setIDSet(true);
	}
	public long getAirlineID() {
		return airlineID;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	public String getCode() {
		return code;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	
	private void setIDSet(boolean isIDSet) {
		this.idSet = isIDSet;
	}

	public boolean isIDSet() {
		return idSet;
	}
	
	@Override
	public boolean equals(Object al) {
		if (al instanceof Airline) {
			Airline alOther = (Airline) al;
			return alOther.code.equals(code);
		}
		return false;
	}

    @Override
    public int hashCode() {
        return code.hashCode();
    }

}

